@extends("admin.base")

@section("content")
  <!-- Content Wrapper. Contains page content -->
      <div >
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            <i class="fa fa-calendar"></i>
      类别信息管理
          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="#">类别信息管理</a></li>
            <li class="active">添加类别信息</li>
          </ol>
        </section>
        @if (count($errors) > 0)
        <div class="mws-form-message error">
            错误信息
            <ul>
                @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
        @endif

        <!-- Main content -->
        <section class="content">
          <div class="row">
            <!-- right column -->
            <div class="col-md-12">
              <!-- Horizontal Form -->
              <div class="box box-primary">
                <div class="box-header with-border">
                  <h3 class="box-title"><i class="fa fa-plus"></i> 添加类别信息</h3>
                </div><!-- /.box-header -->
                

                <!-- form start -->
                <form class="form-horizontal" action="{{url('admin/cate')}}/{{$list->id}}" method="post">

                  <div class="box-body">
                    <div class="form-group">
                      <label for="inputEmail3" class="col-sm-2 control-label" name="pid">父类名称</label>
                      <div class="col-sm-4">
                        <input type="text" name="name" class="form-control" id="inputEmail3" value="{{$list->name}}" placeholder="请输入名称">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputPassword3" class="col-sm-2 control-label">父级分类</label>
                      <div class="col-sm-4">
                        
                        <select class="small" name="pid">    
                            <option value="0">请选择</option>
                           @foreach($info as $k=>$v)
                            <option value="{{$v->id}}" @if($v->id == $list->pid) selected='selected' @endif >{{$v->name}}</option>
                          @endforeach
                        </select>
            
                      </div>
                    </div>
          
                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <div class="checkbox">
                         <div class="mws-form-item clearfix">
                            
                            <input type="radio" name="status" value="1" {{$list->status==1 ? "checked='checked'" : ""}}> 激活 &nbsp;&nbsp;&nbsp;
                            <input type="radio" name="status"  value="0" {{$list->status==0 ? "checked='checked'" : ""}}> 禁止
                        </div>
                        </div>
                      </div>
            
                    </div>
          
                  </div><!-- /.box-body -->
                  <div class="box-footer">
                  <input type="hidden" name="id" value="{{$list->id}}">
                  <input type="hidden" name="_method" value="PUT">
                  <input type="hidden" name="_token" value="{{ csrf_token() }}">
                    <div class="col-sm-offset-2 col-sm-1">
                    <button type="submit" class="btn btn-primary">修改</button>
                    </div>
                    <div class="col-sm-1">
                    <button type="submit" class="btn btn-primary">重置</button>
                    </div>
                  </div><!-- /.box-footer -->
        </form>



        <div class="row"><div class="col-sm-12">&nbsp;</div></div>
              </div><!-- /.box -->
       
            </div><!--/.col (right) -->
          </div>   <!-- /.row -->
        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->

@endsection

